<template>
    <div class="referenceCenter">
        <ComHead :pageTitle="title">
        </ComHead>
        <div class="reference-text">
            <h1>{{ news.title }}</h1>
            <h3>{{ news.createDate }}</h3>
            <div v-html="news.content" class="news-main">
            </div>
        </div>
    </div>
</template>

<script>
    import ComHead from '../../comHead.vue';
    import {
        mapState,
    } from 'vuex';

    export default {
        name: 'referenceCenter',
        data() {
            return {
                title: '资讯中心',-
            }
        },
        components: {
            ComHead,
        },
        computed: mapState({
            news: state => state.find.news,
        }),
        created() {
            this.$store.dispatch('getNews',
                { id: this.$route.params[0], }
            ).then((res)=>{
               if(res.retCode === '0000'){
                   this.title = res.data.title;
               } 
            });
        },

    }
</script>

<style lang="scss">
@import '../../common/scss/_variable.scss';

.referenceCenter{
    .reference-text{
        padding: 20px 15px;
        h1{
            font-size: 15px;
            color: $base-333;
            text-align: center;
            font-weight: normal;
            margin: 0;
        }
        h3{
            padding: 13px 0px 18px;
            font-size: 12px;
            color: $base-666;
            text-align: center;
            font-weight: normal;
        }
        .news-main{
            font-size:13px;
            color: $base-666;
            p{
                padding-bottom: 15px;
                text-indent: 2em;
                line-height: 23px;
            }
            img{
                width: 80%;
                height: auto;
            }
        }
        .sign{
            font-size: 13px;
            color: $base-666;
            text-align: right;
            margin-top: 50px;
            line-height: 30px;
        }
    }
}
</style>
